package edu.ynu.se.xiecheng.achitectureclass.entity;

import edu.ynu.se.xiecheng.achitectureclass.common.entity.LogicEntity;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import java.util.List;

@Entity
@Getter
@Setter
@Where(clause = "is_deleted = 0")
public class Customer extends User {
    @Column
    private String customerId;
    @Column
    private String customerName;
    @Column
    private String phone;
    @OneToMany(mappedBy = "customer") // 指定与 Shop 实体的关联关系
    private List<Order> orders;

    public List getCurrentOrder() {
        return orders;
    }
}
